package com.xqm.springcloud.controller;

import com.xqm.springcloud.pojo.UserInfo;
import com.xqm.springcloud.service.UserInfoService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ShiMing
 * @version 1.0
 * @name UserController
 * @description TODO
 * @date 2020/8/21
 */

@RestController
public class UserController {

    @Autowired
    UserInfoService userInfoService;

    //@Autowired
    //UserInfoServiceApi userInfoServiceApi;

    @GetMapping("/userinfos/{phone}")
    public UserInfo userinfos(@PathVariable String phone) {
        return userInfoService.selectByPhone(phone);
    }

    @GetMapping("/userinfos")
    public List userinfos() {
        return userInfoService.selectAll();
    }
}
